<%--
  Created by IntelliJ IDEA.
  User: Administrator
  Date: 2018\6\8 0008
  Time: 19:22
  To change this template use File | Settings | File Templates.
--%>
<%@ page contentType="text/html;charset=UTF-8" language="java" %>
<html>
<head>
    <jsp:include page="/static/common/common.jsp"></jsp:include>
    <script type="text/javascript" src="/static/js/employee.js"></script>
</head>
<body>
<%--此处必须设计为双标签,否则不能作为容器储存数据--%>
<table id="emp_grid"></table>
<div id="tb">
    <a href="#" class="easyui-linkbutton" data-options="iconCls:'icon-add'" onclick="add()">新增</a>
    <a href="#" class="easyui-linkbutton" data-options="iconCls:'icon-edit'" onclick="edit()">编辑</a>
    <a href="#" id="changeState_btn" class="easyui-linkbutton" iconCls="icon-remove" onclick="changeState()">离职</a>
    <a href="#" class="easyui-linkbutton" iconCls="icon-reload" onclick="reload()">刷新</a>
    <a href="#" class="easyui-linkbutton" iconCls="icon-tip" onclick="resetpassword()">密码重置</a>
    <a href="#" class="easyui-linkbutton" iconCls="icon-print" onclick="exportXls()">导出</a>
    <%--在easyUI中文本框的格式为textboxchangeState--%>
    <%--设置提示内容的属性为prompt--%>

    <input class="easyui-textbox" name="keyword" prompt="请填入用户名或真实姓名以及手机号码">
    <input class="easyui-combobox" name="deptId" prompt="请选择部门" data-options="panelHeight:'auto',valueField:'id',textField:'name',
                                url:'/department/getAll.do'">
    <a href="#" class="easyui-linkbutton" iconCls="icon-search" onclick="query()">搜索</a>

        <form method="post" enctype="multipart/form-data" action="/employee/importXls.do">
            <%--表单提交所需要的文档模板--%>
            <input type="file" name="file"/>
            <input type="submit" value="上传">
        </form>

</div>
<div id="form_btn">
    <a href="#" class="easyui-linkbutton" iconCls="icon-save" onclick="save()">保存</a>
    <a href="#" class="easyui-linkbutton" iconCls="icon-cancel" onclick="cancel()">取消</a>
</div>
<div id="passform_btn">
    <a href="#" class="easyui-linkbutton" iconCls="icon-save" onclick="savepass()">保存</a>
    <a href="#" class="easyui-linkbutton" iconCls="icon-cancel" onclick="cancelpass()">取消</a>
</div>


<%--重置密码弹窗--%>
<div id="resetpassword_dialog">
    <form id="reset_form" method="post" data-url="/employee/rsetPassword.do">
        <input type="hidden" name="id"/>
        <tr>
            <th>请在确认身份后输入新的密码:</th>
        </tr>
        <tr>
            <td><input class="easyui-textbox" name="newpassword" propt="请设定密码"></td>
        </tr>
    </form>
</div>
<%--新增,编辑 弹窗--%>
<div id="emp_dialog">
    <%--切记提交表单的方式--%>
    <form id="emp_form" method="post" data-url="/employee/saveOrUpdate.do">
        <input type="hidden" id="empId" name="id"/>
        <table align="center" style="margin-top: 15px">
            <tr>
                <td>用户名:</td>
                <td>
                    <input name="username" class="easyui-textbox"
                           prompt="请输入用户姓名"
                    <%--设置用户名校验失败后的 无效提示 信息--%>
                           invalidMessage="用户名已存在"
                           validType="remote['/employee/validateUsername.do?id='+empId.value,'username']">
                </td>
            </tr>
            <tr>
                <td>真实姓名:</td>
                <td>
                    <input name="realname" class="easyui-textbox"
                           prompt="请输入用户真实姓名">
                </td>
            </tr>
            <tr id="password_tr">
                <td>密 码:</td>
                <td>
                    <input name="password" class="easyui-passwordbox">
                </td>
            </tr>
            <tr>
                <td>电话:</td>
                <td>
                    <input name="tel" class="easyui-textbox">
                </td>
            </tr>
            <tr>
                <td>邮箱:</td>
                <td>
                    <input name="email" class="easyui-textbox">
                </td>
            </tr>
            <tr>
                <td>入职时间:</td>
                <td>
                    <input name="hireDate" class="easyui-datebox">
                </td>
            </tr>
            <tr>
                <td>部门:</td>
                <td>
                    <input name="dept.id" class="easyui-combobox"
                           data-options="panelHeight:'auto',valueField:'id',textField:'name',
                                url:'/department/getAll.do'">
                </td>
            </tr>
            <tr>
                <td>管理员:</td>
                <td>
                    <input name="admin" class="easyui-combobox"
                    <%--下拉写死的,用label--%>
                           data-options="panelHeight:'auto',valueField:'value',textField:'label',
                                data:[{
                                    label: '是',
                                    value: '1'
                                },{
                                    label: '否',
                                    value: '0'
                                }]">
                </td>
            </tr>
            <tr>
                <td>角色:</td>
                <td><input id="role_combobox" class="easyui-combobox"
                           data-options="multiple:true,panelHeight:'auto',valueField:'id',
                            textField:'name',url:'/role/getAll.do'"></td>
            </tr>
        </table>
    </form>
</div>
</body>
</html>
